import App from './App'
import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
// 引入导航栏组件
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
//导入自己封装的类库
import * as sjuAsync from './common/sju.async.js'
import * as sjuBase from './common/sju.base.js'
import * as sjuAlert from './common/sju.alert.js'
import * as sjuRegex from './common/sju.regex.js'
import * as sjuLogin from './common/sju.login.js'
import * as sjuNav from './common/sju.nav.js'
import * as sjuPay from './common/sju.pay.js'
import * as sjuTools from './common/sju.tools.js'
import * as sjuRequest from './common/sju.request.js'

export function createApp() {
	const app = createSSRApp(App)
	app.use(Pinia.createPinia())
	app.component(uniNavBar)
	// 将封装库引入
	app.config.globalProperties.sjuBase= sjuBase
	app.config.globalProperties.sjuAlert= sjuAlert
	app.config.globalProperties.sjuRequest= sjuRequest
	app.config.globalProperties.sjuAsync= sjuAsync
	app.config.globalProperties.sjuLogin= sjuLogin
	app.config.globalProperties.sjuNav= sjuNav
	app.config.globalProperties.sjuPay= sjuPay
	app.config.globalProperties.sjuRegex= sjuRegex
	app.config.globalProperties.sjuTools= sjuTools
	
	return {
		app,
		Pinia
	}
}